public class TriangleExercises {

    public static void main(String[] args)  {

        printOneAsterisk();
        System.out.println();

        printHorizontalLine(8);
        System.out.println();

        printVerticalLine(3);

        printRightTriangle(5);
    }

    private static void printRightTriangle(int height) {
        for(int i =  0; i < height; i++) {
            printHorizontalLine(i+1);
            System.out.println();
        }
    }

    private static void printVerticalLine(int height) {
        for(int i = 0; i < height; i++) {
            printOneAsterisk();
            System.out.println();
        }
    }

    private static void printHorizontalLine(int length) {
        for(int i = 0; i < length; i++) {
            printOneAsterisk();
        }
    }

    private static void printOneAsterisk() {
        System.out.print("*");
    }
}
